<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浏览器对象</title>
</head>
<body>
<h1>BOM</h1>
<button onclick="goback()">回退</button>
<script>
    document.write(window.location.href+'<br>');
    document.write(window.location.hostname+'<br>');
    // window.open("http://www.baidu.com");
    function goback() {
        window.history.back();
    }
    //警示框
    window.alert("这是一个警示框");
    //确认框
    var boolVal=window.confirm("你确认吗？");
    //提示框
    //格式：window.prompt("sometext","defaultText");
    var name=window.prompt("输入值","默认值");

    var x=document.cookie;
    document.write("cookie :"+x);
</script>
</body>
</html>